﻿<UserControl x:Class="Test.Silverlight.ControlToolkit.ValidatorDemo"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
    xmlns:sctw="clr-namespace:Silverlight.ControlToolkit.Windows;assembly=Silverlight.ControlToolkit"
    xmlns:sctv="clr-namespace:Silverlight.ControlToolkit.Validator;assembly=Silverlight.ControlToolkit"
    xmlns:scts="clr-namespace:Silverlight.ControlToolkit.ControlService;assembly=Silverlight.ControlToolkit"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
    Width="800" Height="600">

    <Grid x:Name="LayoutRoot" HorizontalAlignment="Left" VerticalAlignment="Top" >
        
        <sctw:WindowPanel Margin="1"  IsExpandable="False" IsExpandedOnLoad="True" Width="400" Height="300" HorizontalContentAlignment="Left" Background="Beige" HeaderBackground="Navy" BorderBrush="Green" HeaderForeground="White" HeaderText="Validation Framework Demo ">
            <Grid x:Name="GridPanel" scts:DirtyReadTracker.TrackDirtyRead="True" sctv:ValidationSummary.DisplayMode="Simple" Background="White" Width="350" HorizontalAlignment="Left" VerticalAlignment="Top" >
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="200" />
                    <ColumnDefinition Width="*" />
                </Grid.ColumnDefinitions>
                <Grid.RowDefinitions>
                    <RowDefinition/>
                    <RowDefinition/>
                    <RowDefinition/>
                    <RowDefinition/>
                    <RowDefinition/>
                    <RowDefinition/>
                    <RowDefinition/>
                    <RowDefinition/>
                    <RowDefinition/>
                    <RowDefinition/>
                </Grid.RowDefinitions>

                <TextBlock x:Name="lblNormal" Grid.Column="0" Grid.Row="0" Text="Normal:" VerticalAlignment="Center" HorizontalAlignment="Right" />
                <TextBlock x:Name="lblRequired"  Grid.Column="0" Grid.Row="1" Text="Required:" VerticalAlignment="Center" HorizontalAlignment="Right" />
                <TextBlock Grid.Column="0" Grid.Row="2" Text="Phone:" VerticalAlignment="Center" HorizontalAlignment="Right" />
                <TextBlock Grid.Column="0" Grid.Row="2" Text="Required Phone:" VerticalAlignment="Center" HorizontalAlignment="Right" />
                <TextBlock Grid.Column="0" Grid.Row="3" Text="SSN:" VerticalAlignment="Center" HorizontalAlignment="Right" />
                <TextBlock x:Name="lblAmount" Grid.Column="0" Grid.Row="4" Text="Amount:" VerticalAlignment="Center" HorizontalAlignment="Right" />
                <TextBlock Grid.Column="0" Grid.Row="5" Text="Range:" VerticalAlignment="Center" HorizontalAlignment="Right" />
                <TextBlock x:Name="lblCustom" Grid.Column="0" Grid.Row="6" Text="Custom:" VerticalAlignment="Center" HorizontalAlignment="Right" />
                <TextBlock Grid.Column="0" Grid.Row="7" Text="Regex:" VerticalAlignment="Center" HorizontalAlignment="Right" />
                <TextBox x:Name="txtNormal" Grid.Column="1" Grid.Row="0" Width="100" Height="25" HorizontalAlignment="Left"/>
                <TextBox x:Name="txtRequired" sctv:Validator.DataType="Custom" sctv:Validator.IsRequired="True" Grid.Column="1" Grid.Row="1" Width="100" Height="25" HorizontalAlignment="Left" UseLayoutRounding="True" />
                <TextBox x:Name="txtRequiredPhone" Grid.Column="1" Grid.Row="2" Width="100" Height="25" HorizontalAlignment="Left"/>
                <TextBox x:Name="txtSSN" Grid.Column="1" Grid.Row="3" Width="100" Height="25" HorizontalAlignment="Left"/>
                <TextBox x:Name="txtAmount" sctv:Validator.DataType="Currency" sctv:Validator.MinValue="100" sctv:Validator.MaxValue="500" sctv:Validator.DisplayControlName="lblAmount" sctv:Validator.NegativeAllowed="True" Grid.Column="1" Grid.Row="4" Width="100" Height="25" HorizontalAlignment="Left"/>
                <TextBox x:Name="txtRange" Grid.Column="1" Grid.Row="5" Width="100" Height="25" HorizontalAlignment="Left"/>
                <TextBox x:Name="txtCustom" sctv:Validator.DataType="Custom" Grid.Column="1" Grid.Row="6" Width="100" Height="25" HorizontalAlignment="Left"/>
                <TextBox x:Name="txtRegEx" Grid.Column="1" Grid.Row="7" Width="100" Height="25" HorizontalAlignment="Left"/>
                <Button Grid.ColumnSpan="2" Grid.Row="8" Margin="2" Content="Save" Click="btnValidateAll_Click" x:Name="btnValidateAll"  />

            </Grid>
        </sctw:WindowPanel>
    </Grid>

</UserControl>
